package thinkingJava.chapter14;
class Candy {
	static {
		System.out.println("loading Candy");
	}
}
class Gum {
	static {
		System.out.println("loading Gum");
	}
}
class Cookie {
	static {
		System.out.println("loading Cookie");
	}
}
public class SweetShop {

	public static void main(String[] args) {
		print("inside main");
		new Candy();
		print("after create Candy");
		try {
			Class.forName("thinkingJava.chapter14.Gum");
		} catch (ClassNotFoundException e) {
			print("could not found class 'Gum'");
		}
		print("after Class.forName(\"Gum\")");
		new Cookie();
		print("after create Cookie");
	}
	public static void print(Object o) {
		System.out.println(o);
	}
}
